package doipSample;

import org.bdware.doip.codec.doipMessage.DoipMessage;
import org.bdware.doip.endpoint.server.DoipServiceInfo;
import org.bdware.doip.endpoint.server.RepositoryHandlerBase;

public class SampleDOIPHandler extends RepositoryHandlerBase {

    public SampleDOIPHandler(DoipServiceInfo info) {
        super(info);
    }

    @Override
    public DoipMessage handleHello(DoipMessage request) {
        return replyDoipServiceInfo(request);
    }

    @Override
    public DoipMessage handleListOps(DoipMessage request) {
        return replyAllOperations(request);
    }

    @Override
    public DoipMessage handleCreate(DoipMessage request) {
        return replyString(request,"create");
    }

    @Override
    public DoipMessage handleUpdate(DoipMessage request) {
        return replyString(request,"update");
    }

    @Override
    public DoipMessage handleDelete(DoipMessage request) {
        return replyString(request,"delete");
    }

    @Override
    public DoipMessage handleRetrieve(DoipMessage request) {
        return replyString(request,"retrieve");
    }
}
